﻿using RFID.BLL;
using RFID.Model;
using System;

namespace RFID.PC.AppCenter
{
    public partial class AddRichForm : ChildForm
    {
        public AddRichForm(MainForm main, object sender)
            : base(main, sender)
        {
            InitializeComponent();
            Text = Title;
        }

        private void TxtCard_DoubleClick(object sender, EventArgs e)
        {
            GetTagIdByDoubleClick(sender);
        }

        private void BtnOK_Click(object sender, EventArgs e)
        {
            RichInfo rich = new RichInfo()
            {
                RId = txtCard.Text,
                Rich = decimal.Parse(txtMoney.Text)
            };
            var result = RichInfoBLL.AddRich(rich);
            ShowResult(result);
        }
    }
}
